package com.senlin.ethereum.util;

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;

public class EthUtil {

    public static class Hex {

        public static String decode(String input) {
            if (input.startsWith("0x"))
                input = input.substring(2);
            byte[] buffer = null;
            try {
                buffer = org.apache.commons.codec.binary.Hex.decodeHex(input);
            } catch (DecoderException e) {
                e.printStackTrace();
            }
            return new String(buffer);
        }
    }

}
